﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Models.Constant
{

    public class ConstantViewConvert
    {

        public static string deviceStatusConvert(string key)
        {
            Dictionary<string, string> map = new Dictionary<string, string>();
            map.Add("open", "打开");
            map.Add("close", "关闭");
            map.Add("yes", "是");
            map.Add("no", "否");
            map.TryGetValue(key, out string value);
            if(string.IsNullOrEmpty(value))
            {
                return key;
            }
            return value;
        }
    }

}
